//引入request
import request from '@/utils/request'
//引入数据类型
import type { trademarkResponseData, trademark } from './model/trademark'
//枚举接口地址
enum API {
    TRADEMARKLIST = '/admin/product/baseTrademark/',
    UPDATETRADEMARK = '/admin/product/baseTrademark/update',
    ADDTRADEMARK = '/admin/product/baseTrademark/save',
    DELETETRADEMARK = '/admin/product/baseTrademark/remove/'
}
//获取品牌数据接口
export const reqTradeMarkList = (page: number, limit: number) => request.get<any, trademarkResponseData>(API.TRADEMARKLIST + `${page}/${limit}`)

//添加或修改品牌接口
export const reqAddOrUpdateTradeMark = (data: trademark) => {
    if (data.id) {
        return request.put<any, any>(API.UPDATETRADEMARK, data)
    } else {
        return request.post<any, any>(API.ADDTRADEMARK, data);
    }
}

//定义删除品牌接口
export const reqDeleteTradeMark = (id:number) =>request.delete<any,any>(API.DELETETRADEMARK+id)